home *** CD-ROM | disk | FTP | other *** search
/ bioinformatics.org / bioinformatics.org_software.tar / www.bioinformatics.org / download / ecell2 / ecell220setup.exe / {app} / standard / STDR / MassActionReactor.rd < prev    next >
Text File  |  2000-03-03  |  2KB  |  66 lines

  1. @CLASSNAME: MassActionReactor
  2.  
  3. @BASECLASS: FluxReactor
  4. @AUTHOR: Kouichi Takahashi
  5. @EMAIL: shafi@sfc.keio.ac.jp
  6. @DATE: 29/6/1999
  7.  
  8. %VERSION: ecs-v09, 0.1
  9.  
  10. @BRIEF_DESCRIPTION:General Mass Action
  11.  
  12. @DESCRIPTION: 
  13. A reactor class in which general mass action equation is embeded. 
  14. Velocity is\\ calculated as a product of concentrations of substrates
  15. and a kinetic constant (see\\ Equation). 
  16. General mass action law is generally applicable to simple kinetic \\ processes
  17. such as elementary reaction and other processes in which velocity
  18. is\\ directly propotional to their substrates.
  19.  
  20. @EQUATION:$$v=k \prod_{i=0}^n [S_i]^{c_i}$$
  21.  
  22. %SUBSTANCE:Substrate, inf, 1
  23. %SUBSTANCE:Product, inf, 1
  24. %SUBSTANCE:Catalyst, 0, 0
  25. %SUBSTANCE:Effector, 0, 0
  26.  
  27. %PARAMETER: k, Float, , Velocity Constant
  28.  
  29. %INCLUDE_FILE_C: stdio.h
  30.  
  31. @INITIALIZE_FUNC:
  32.   for(int i = 0 ; i<numSubstrate() ; i++){
  33.     if(!substrate(i)->substance().haveConcentration())
  34.       {
  35.     char buf[50];
  36.     sprintf(buf,"Cannot calculate concentration of substrate [%s].",
  37.         substrate(i)->substance().entryname().c_str());
  38.     warning(buf),condition(InitFail);
  39.       }
  40.   }
  41. @REACT_FUNC:
  42.   // k * [S] = v    : mol/L  * s^-1 <- velocity in concentration!? (-_-;
  43.   // v * volume * N_A : numMol * s^-1  <- this is it! \(^^)
  44.   // (where N_A is Avogadro number)
  45.  
  46.   // first calculate N_A * system volume * k for precision
  47.   Float velocity = k*N_A;
  48.   velocity *= _substrateList[0]->substance().supersystem()->volume();
  49.  
  50.   int i = numSubstrate();
  51.   do{
  52.     --i;
  53.     // calculate velocity
  54.     int j = substrate(i)->coefficient();
  55.     do{
  56.       j--;
  57.       velocity *= substrate(i)->concentration();
  58.       } while(j != 0);
  59.   } while(i != 0);
  60.  
  61.  
  62.   // now we have change in number of molecules per second
  63.  
  64.   process(velocity);
  65.  
  66.